package com.quanxi.qxaimain.dao.cleaner;

import com.quanxi.qxaimain.common.datasource.datasourceAOP.annotation.DataSource;
import com.quanxi.qxaimain.common.datasource.datasourceAOP.enums.DataSourceEnum;
import com.quanxi.qxaimain.model.doctoradivce.CleanDoctorAdvice;
import com.quanxi.qxaimain.model.doctoradivce.DoctorAdvice;
import com.quanxi.qxaimain.model.doctoradivce.DoctorAdviceKeyword;
import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.session.ResultHandler;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Liang Zhang
 * @date 2022/11/08
 */
@Component
public interface CleanerMapper {
    @DataSource(DataSourceEnum.DB5)
    List<DoctorAdvice> findYizhu(Date start_date, Date end_date);

    @DataSource(DataSourceEnum.DB5)
    void findYizhuStream(ResultHandler<Map<String,Object>> resultHandler, Date start_date, Date end_date);

    @DataSource(DataSourceEnum.DB5)
    void updateYizhu(Date start_date, Date end_date, String key_word, int class_no);

    @DataSource(DataSourceEnum.DB5)
    List<DoctorAdviceKeyword> findYizhuKeyWordWithFlag1();

    @DataSource(DataSourceEnum.DB5)
    List<DoctorAdviceKeyword> findYizhuKeyWordWithFlag0();

    @DataSource(DataSourceEnum.DB5)
    List<DoctorAdviceKeyword> findYizhuKeyWordByClassNoWithFlag1(int class_no);

    @DataSource(DataSourceEnum.DB5)
    List<DoctorAdviceKeyword> findYizhuKeyWordByClassNoWithFlag0(int class_no);

    @DataSource(DataSourceEnum.DB5)
    void insertSingleYizhu(String doc_adv_id, String inpatient_visit_form_no, String doc_adv_detail_name, String key_word, int class_no);

    @DataSource(DataSourceEnum.DB5)
    void updateSingleYizhuWithFlag0(String doc_adv_id, String inpatient_visit_form_no, String doc_adv_detail_name, String key_word, int class_no);

    @DataSource(DataSourceEnum.DB5)
    Integer deleteYizhuBatch(List<CleanDoctorAdvice> list);

    @DataSource(DataSourceEnum.DB5)
    Integer deleteYizhuByClassNo(int class_no);

    @DataSource(DataSourceEnum.DB5)
    Integer insertYizhuBatch(List<CleanDoctorAdvice> list);

    @DataSource(DataSourceEnum.DB5)
    void updateCleanFlag(Date start_date, Date end_date);


}
